package com.offcn.utils;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000121637921";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDBNSxzj/LbfpzKyxKPcTswPTCCqiAQu17CvU4YooPEwbmCb5jI6iiNgFdRHsxJyCsIeqorAFVbzeQD5b01MQfOb0P0SNAcAHDrLk7rCb+xWOGkIWIYIEE8r8d/kiHYDRRx1CzZi9PEJLxYs7NPgPrb0a6m2czI5tascn0feOo7Y7eeI4eC8f5mj1JCdXsir5O6E3PzwZDSGsK7OUf7S2bbGzKnMVfTeUX1PxltKvtREPpwQAK0PIXS80YDRHgENtWAW8VIXnr6IWstlTqeR17L0b8ALMgan78sWNPPqV0dXOtoF+RIeEBWyNOeWK0msKL7F0G6TJA48wK2R7PqWkkhAgMBAAECggEAPmJV9QZwyzCpnc1OM+TC0MOhKz+VVPG7GjQXyFqJI3nN1XEFKzJ4X6AmEXpZSiWIx5cb5QCZjyf+zMdcfZVUSPKiRXlRQQlfbICqWLfwHmptiRqCWvnnNponV2iu5tzqUgrJZIECop2d9yIm7q/d0CZ3N0ayGdh3Tn01K3lWYFA1ThTLFtosDNwUlmC5l6c/PmAgleH+ZO5xCpl6rakkrJARpdZuefQsy8BzPDEdopISCdpNuIsVKA0MUQNGvFXI9c1X1/xZ8XJk0kkIZKjN3xevx3mWAF3dO10weNZcJ1VCuDlIKW/idjYPPXBP9KbpbHejeoI3q/UN66Z+BMBt5QKBgQDvuqsiGlkqwqfHH2PvOxDlLSfPIAH7TbF1JzTTvFibbdcmQGhbFEp6L8M3Z+TUikANKIk2fckohSHTJ0+kCUvSXDnrsyewk+5isp64TdalphDyA2t1UnaaVdQzrdHiyR1HzR/4wDusX4KQKO4V/OBoa4ywcvYNbuH0AnGiixfQbwKBgQDOUjAAUwLv41fm2z2VJJH0znk8cqUfewmfWKKtSPSUv6eJoE8QBqLdVpTBh8rLBOe8XrUrb43l/pyjPL476pqeipvAO/FKQByTlXiG9qYLKMI61S3Yp+jo6kfZOJZkZk40QIOC1GpbZVI5AyWLQnVD2OB/kNjvLs7GhNf4oRonbwKBgF4FAO8sFEJ/+1tOBVyi9rpbHlzOedh8nReMW9ya5sl2p8XZxtPJvnfzWYXWWlm9Kue+OSpE5OreY+izZzm3Z6RGBXVaWzuWmQzebv9rj76Bxe2Ux8VIpTlcZhAqoMFoDPLHET327rBo+QTe+JlpBv4NCC1/uN6F2Vpgxv5vvNRDAoGARlroW3PzMHJJ60MfwNfznZM67E372LxQD7Jd5tFV9dNVAi1USJa6utdnaocvtAM8MpPpG6KytJcaOt/fzva1OxLxAaBvK26pT/pMW1mITY3cjctcEuFPHv2k+oG9Zwcr682ECvz8N6ZZX2+fQdmruzMdeuKd1xITGMb8DqCBFqkCgYEA7IwJL36x6zWZMV5UeF2X7EDX2FBwNfKVEVIgYhrk+Fe8A0r8HZUX1Ft/oi3BHhn6l3kwftZz84dZcAyz0rXP0XnQ/h2FwMY9hsp/op0kOXaQLKQITBgIXQeQojBtuPmLvrUYXUz8e209ZzBJHvd0dS8h+qgLyVFNY5kLS2Lm6C4=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgO14ijQVcqvX7r2DvYDRSJx7AXrhVlwziR+WL/ACzaZVahoZScW+p8DvNwNk6DIMzhTQx8s0b7GhlcSM02a7G3SIAEJ57u4q7JLZGbjECqTXtjsXFaqreKkt6SrE35u1VYfx/NlpOnM9fY/Mhjabk/JCyrfI7Lds58NAWD1KCew+5saKIL2nfpz/FgAhCC4zNWz0lHqq5xYmLNcGrEaVRFxspq86sZ3hoDSfcGihWRoreD+A+F8ZmFFs5Zl+Qd4MUmIs31GcJ74jNSV07T7NXBocia5/0XTHitpF0HzWhrvTO6ADtcYm3tKfXkDobw7LGP79hSRqGjYvkdiUo9yfHwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/myedutest_war_exploded/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/myedutest_war_exploded/return_url.jsp";


	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

